﻿package com.yj.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2021000118604643";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC1+2dIf5iUH43Yiy/nXaK2eEh201c2mb/oFL2fv5TR+ZiZUgMTFfUbKagp4SmNFMBh92aKXF0lZsdTNEr2Z+QFQfhQY1/2gtRqjsyyP/SEf/x0hIcY/pAk0+2T98NCM/8yCeITQrS1i8nZFKSpc+nk+hZLD63T9PeBmzRnnpvXubtsWtdjNmFm5NSjIQVBJEDUhrEZnY+eAtTDePQ6+fQRLYJ6RCrAKQ6FiRXpWnBnGokb4jNnQoRMLJMYVGIjlNTcouanoeTggdODqaMGlf/8bzQTRuE99RILsm7z5yDPuNazT+yPK+DPCXqdNnAEhvyMM1V8LR2muSn8mEIaazj1AgMBAAECggEAI4Pa1kVAi7fUwOv4/1hAxweWbMo1/QvobeyOTTzgWFIzu8hLnU/ts81fajztFQF1wii8NEhuTTxPridIceo4j+YeBeI++ibyOZGA1VCx8aHgrQSoMPKNQwKxHO1/h84KAcP4APZFuiB71ge3UvKyNOOxshhvPixSmVKm2YoUs/bQzi2y4PDU6CBtaN3Vh/M4m3ya5jv70AyKjr4jRbJH52lHqiA/b8h+ogDrd0CDF7S/87FEkbdhfSJmwMl5AtPRQ2zOjK0RBnyYW7Vq3mXxHgOcwWyfCXv3+yN5VBvnQUZGU3tuFRK/5Q4XWgnqPrfkv2xPoTFtlpJcm+KdlDYhgQKBgQDr8lpfz/4WTmmUhgcmz1inHAW/4cROL50vKsf1H0c4eIvHEnp7wX6c4DnV9FiN5A4XJVdX/wjP5F5PTgdo+tvDwaGcgzJSq5NKSmekg2X7u+vV9DmQRMv8WuGhdial91sWXTtrDfsN3vVKomUdJaVQSDchJPH+elN1gS/qwDJvEQKBgQDFcuf8oFDgJyVuw6VzNH4MeekYjVZ49DbrEKa1Szln7+BRxlfsZvLaKE0EyZLpRdgNE0zsZpXK5Iudb77Thg8sGgr6SlAnDU70V12k7RgWbVVld1+cgpuVuoOc8Q6sddvRWrqGN+B2OrKLAh431jtkyIwtBmL6Lz2R7hzaW7VzpQKBgQDfOE+L6cjm7ZQxcYN+khe7MWW3HS6NEbrRjtXR759/q3wCAFdkkbDpVbEh26OTybgS6b7yf1Ok6tbWjGmyRfJ4Bs6QtgZ789rLJA1dtPpc6HK73ew/svaRbqGcEZ2K0rOYOugl5fooK1FBJNYodx8pDskpUDyplq0ys9/TZbXRIQKBgEA+nxUn5KjKk/dyWUce8VSF5j5C3rwEWkop5NRgYZFcD5UMAFe/N42cR1Mjc1XLj/zRJtpUlrCppHPZhDG3EQC8iI3f2Cycu+/s7V9Yddn2QS7+pHF8XbteMKzEEo4y2w9HgiFh1PsjJizsx4BLiI/GYTXVOidFb7cnzuONq4CxAoGAQhQL1LQ30OAoIgXe7AbTJUq3X2yuxGkRob3w1vU8B0hzKvVs1G2yd75+wJmMviNLQ4wN/4r2n9BiDWYrlmvugCxGbH9Qc86Vol3xQIR4INrqt0ufBi3YFeA94sBRXcrvY6zm+xYOALY9i5cGZgGSB/+P+abZrW+0eYUtVnJbI2Y=";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAgvpPyQvBvkI9pQPAd6bG2uVm9QDPc3iSeSRs5pyhx00PjCNSJ3+OxVRp3Y769Dg8EA85s4q7istRonUreOSWQf/M5TuC3xNwieGVkTGmLMCwGW2aM4w/Ou7DULELsGeuEnBVyLAODZhsJqNSFKhanKgOZj1XSoQ5UBq6s3SCC5uQGFUhr0jq52UI/bxbUfnP4KpNBd4BxsEqP+mK9rBDonu0BmZnJfDHoX+WV7+xA/gRjS2bo7hOMwQHxUZk4/OawGZXTbkS9kW6TPbiu9p7ZN4Oda4GvdupJkBbZW2psK3Q/dZ6EvM05GZZbef8HG7GwSm0JZYLMVz1LFB8NADHUwIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://127.0.0.1:8080/notify_url";
	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问

    public static String return_url = "http://127.0.0.1:8080/return_url";


	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

